package com.white.hot.controller.umpush;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.white.hot.constant.ConstantInfo;
import com.white.hot.dto.resp.BaseResp;

@Controller
@RequestMapping("/umpush")
public class PushController
{
	@RequestMapping("/notifyOne")
	@ResponseBody
	private Object nofityOne(HttpServletRequest request, HttpServletResponse resp)
	{
		try {
			Map<String ,Object> map = new HashMap<String,Object>();
			map.put("ticker", "fuck");
			map.put("title", "fuck");
			map.put("text", "fuck");
			PushUtils.sendAndroidBroadcast(map);
			BaseResp br = new BaseResp();
			br.setStatus(ConstantInfo.RSC_SUCCESS);
			br.setInfo(ConstantInfo.RSS_SUCCESS);
			return br;
		} catch (Exception ex) {
			ex.printStackTrace();
			BaseResp br = new BaseResp();
			br.setStatus(ConstantInfo.RSC_INNER_ERROR);
			br.setInfo(ConstantInfo.RSS_INNER_ERROR);
			return br;
		}
	}
}
